import java.util.Scanner;

public class Main1060 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int x=0;
        if (n%2==1){
            for (int i=2;i<=n;i+=2){
                    x+=i;
            }
        }else {
            for (int i=1;i<=n;i++){
                if (n%i==0){
                    x+=i;
                }
            }
        }
        System.out.println(x);
    }
}
